package com.example.demo.controller;

import com.example.demo.bean.Time;
import com.example.demo.sevice.TimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TimeController {

    @Autowired
    private TimeService timeService;

    @RequestMapping("/time")
    public List<Time> time(String Hospital) {
        return timeService.time(Hospital);
    }

    @RequestMapping("/time1")
    public void insert(Time time) {
        timeService.insert(time);
    }

    @RequestMapping("/time2")
    public void delete(String operation) {
        timeService.delete(operation);
    }

    @RequestMapping("/time3")
    public void update(Time time) {
        timeService.update(time);
    }
}
